<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增机构储存空间配置')" />
	<!-- 引入jQuery官方类库 -->
	<script type="text/javascript" src="../../../static/jquery/jquery-3.2.1/jquery-3.2.1.js"></script>
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content" th:width="1200">
		<form class="form-horizontal m" id="form-dept-add">
			<input name="deptId" type="hidden" id="treeId"/>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">资源路径：</label>
				<div class="col-sm-8" >
					<input class="form-control" placeholder="请填写资源路径" type="text" name="fileDirPath" id="fileDirPath" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">容量(MB)：</label>
				<div class="col-sm-8">
					<input class="form-control" placeholder="请填写容量(MB)" maxlength="9" type="text" name="memory" id="memory" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">归属组织：</label>
				<div class="col-sm-8">
					<div class="input-group">
						<input name="deptName" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择组织机构" class="form-control" required>
						<span class="input-group-addon"><i class="fa fa-search"></i></span>
					</div>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "system/fileconf";

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-dept-add').serialize());
            }
        }

        /* 新增-选择组织树 */
        function selectDeptTree() {
            var url = ctx + "system/user/selectDeptTree/";
            var options = {
                title: '选择组织',
                width: "380",
                url: url,
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        }

        function doSubmit(index, layero){
            var body = $.modal.getChildFrame(index);
            $("#treeId").val(body.find('#treeId').val());
            $("#treeName").val(body.find('#treeName').val());
            $.modal.close(index);
        }
	</script>
</body>
</html>
